﻿using System;
using System.Collections.Generic;
public partial class HandlePlayerMsg
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="player"></param>
    /// <param name="protoBase"></param>
    public void MsgStarted(Player player, ProtocolBase protoBase) {
        ProtocolBytes protocol = new ProtocolBytes();
        protocol.AddString("Started");
        //条件判断(判断该房间的状态是不是准备状态)
        if (player.tempData.status != PlayerTempData.Status.Room)
        {
            Console.WriteLine("MsgStartFight status err " + player.id);
            protocol.AddInt(-1);
            player.Send(protocol);
            return;
        }
        Room room = player.tempData.room;
        if (!room.CanStart())//判断房间是否不可以开战（不可以开战给客户端返回-1）
        {
            Console.WriteLine("MsgStartFight CanStart err " + player.id);
            protocol.AddInt(-1);
            player.Send(protocol);
            return;
        }

        //开始战斗(否则返回0)
        protocol.AddInt(0);
        player.Send(protocol);
        room.StartFight();

    }
    /// <summary>
    /// 发牌
    /// </summary>
    /// <param name="player"></param>
    /// <param name="protoBase"></param>
    public void MsgFCard(Player player, ProtocolBase protoBase)
    {

    }




    }

